import { InitAPI } from "cess-js-sdk-frontend";
import webconfig from "../webconfig";

async function getAPI(){
    if(!window.api){
        try{
        const { api, keyring } =await InitAPI();
        window.api=api;
        window.keyring=keyring;
    }catch(e){
        console.log('window.pai')
        console.log(e);
    }
    }
    return window.api;
}

export { getAPI };